import java.net.SocketPermission;
import java.util.Scanner;

public class ChengFaKouJue {
    /**
     * 输出乘法口诀
     */
    public void chengFaKouJue() {
        int result = 0;
        int j = 1;
        for (int i = 1; i < 10; i++) {
            for (; j < 10; ) {
                result = i * j;
                System.out.print(i + "*" + j + "=" + result + "  ");
                j++;
            }
            j = i + 1;
            System.out.println();
        }
    }

    /**
     * 乘法口诀输出，第种方式
     */
    public void chengFaKouJueTwo() {
        int result2 = 0;
        for (int j = 1; j < 10; j++) {
            for (int i = 1; i <= j; i++) {
                result2 = i * j;
                System.out.print(i + "*" + j + "=" + result2 + "  ");
            }
            System.out.println();
        }
    }

    /**
     * 输出金字塔
     */

    public void jinZiTa(int num) {

        for (int j = 1; j <= num; j++) {
            for (int k = j; k < num; k++) {
                System.out.print(" ");
            }
            for (int i = 1; i <= (2 * j - 1); i++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    /**
     * 百钱百鸡问题
     */
    public void moneyChicken() {
        int mon = 100;
        int g, m;
        float x = 1f;
        for (g = 1; g <= 20; g++) {
            for (m = 1; m <= 33 & m > 0; m++) {
                x = 3 * (mon - 5 * g - 3 * m);
                float k = 100 - x - g - m;
                int x0 = (int) x;
                if (x == x0 & k == 0) {
                    System.out.println("公鸡：" + g + " 母鸡：" + m + " 小鸡：" + x0);
                }
            }
        }
    }

    /**
     * 判断用户输入数字的奇偶
     */
    public void dataInOut() {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个整数数字：");
        String shu = sc.next();
        do {
            if (shu != null && shu.matches("[0-9]+")) {
                int shuZi = Integer.parseInt(shu);
                if (shuZi % 2 == 0) {
                    System.out.println(shu + "是偶数");
                } else {
                    System.out.println(shu + "是奇数");
                }
            } else {
                System.out.println("您输入的数据不合法！");
            }
            shu = sc.next();
        }
        while (true);

    }

    /**
     * 聊天
     */
    public void chatWindow() {
        Scanner qus = new Scanner(System.in);
        System.out.print("请输入内容：");
        String cont = qus.next();
        while (true) {
            if (cont.contains("你好")) {
                System.out.println("你好，欢迎跟我聊天！");
            } else if (cont.contains("名字")) {
                System.out.println("我叫亚赛");
            } else if (cont.contains("年龄")) {
                System.out.println("我26岁了");
            } else if (cont.contains("哪里")) {
                System.out.println("我是河南人哦");
            } else {
                System.out.println("你说的我好像不知道哦");
            }
            cont = qus.next();
        }
    }


}
